from SimpleCrypto import SimpleCrypto


# 解密:
def decrypt(text, key):
    """
    解密
    :param text: 要解密的文本
    :param key: 密钥
    :return: 解密后的文本
    """
    Plain_text = SimpleCrypto(key)
    return Plain_text.decrypt(text)


# 加密:
def Ciphertext(text, key):
    """
    加密
    :param text: 要加密的文本
    :param key: 密钥
    :return: 加密后的文本
    """
    ciphertext = SimpleCrypto(key)
    return ciphertext.encrypt(text)


if __name__ == '__main__':
    key = "mysecretkey"
    Text = "Hello World"
    Ming = Ciphertext(Text, key)
    print(Ming)
    print(decrypt(Ming, key))
